import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('cart', () => {
  let piniaCart=ref([])
  function piniaAdd(detail,goods_id){
    console.log('数据1',detail);
    console.log('数据2',goods_id);
    piniaCart.value.push({
        username:localStorage.getItem('username'),
        id:Math.floor(Math.random()*1000000),
        Number:1,
        goods:detail,
        checked:false,
    })
  }
  return { piniaCart,piniaAdd }
})
